package util

import (
	"crypto/sha256"
	"encoding/hex"
)

func GetHashPassword(password string) string {
	h := sha256.New()
	h.Write([]byte(password))
	res := h.Sum(nil)
	return hex.EncodeToString(res)
}

func VerifyPassword(password string, hashPassword string, salt string) bool {
	return GetHashPassword(password+salt) == hashPassword
}
